package com.yuedao.sender.model1;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * AssistDemo
 * com.chris.demo.model.orm
 * Created by Chris Chen
 * 2018/1/5
 * Explain:
 */
@Entity(name = "ydx_franchisees")
public class FranchiseeEntity {
    private int id;
    private String orgName;
    private Timestamp joinDate;
    private String address;
    private Integer longitude;
    private Integer latitude;
    private Integer available;
    private String description;
    private Integer contactPersonId;
    private Integer dividendTypeId;
    private Integer cityId;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "org_name", nullable = false, length = 128)
    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    @Basic
    @Column(name = "join_date", nullable = false)
    public Timestamp getJoinDate() {
        return joinDate;
    }

    public void setJoinDate(Timestamp joinDate) {
        this.joinDate = joinDate;
    }

    @Basic
    @Column(name = "address", nullable = true, length = 1024)
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Basic
    @Column(name = "longitude", nullable = true)
    public Integer getLongitude() {
        return longitude;
    }

    public void setLongitude(Integer longitude) {
        this.longitude = longitude;
    }

    @Basic
    @Column(name = "latitude", nullable = true)
    public Integer getLatitude() {
        return latitude;
    }

    public void setLatitude(Integer latitude) {
        this.latitude = latitude;
    }

    @Basic
    @Column(name = "available", nullable = true)
    public Integer getAvailable() {
        return available;
    }

    public void setAvailable(Integer available) {
        this.available = available;
    }

    @Basic
    @Column(name = "description", nullable = true, length = 2048)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "contact_person_id", nullable = true)
    public Integer getContactPersonId() {
        return contactPersonId;
    }

    public void setContactPersonId(Integer contactPersonId) {
        this.contactPersonId = contactPersonId;
    }

    @Basic
    @Column(name = "dividend_type_id", nullable = true)
    public Integer getDividendTypeId() {
        return dividendTypeId;
    }

    public void setDividendTypeId(Integer dividendTypeId) {
        this.dividendTypeId = dividendTypeId;
    }

    @Basic
    @Column(name = "city_id", nullable = true)
    public Integer getCityId() {
        return cityId;
    }

    public void setCityId(Integer cityId) {
        this.cityId = cityId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        FranchiseeEntity that = (FranchiseeEntity) o;

        if (id != that.id) return false;
        if (orgName != null ? !orgName.equals(that.orgName) : that.orgName != null) return false;
        if (joinDate != null ? !joinDate.equals(that.joinDate) : that.joinDate != null) return false;
        if (address != null ? !address.equals(that.address) : that.address != null) return false;
        if (longitude != null ? !longitude.equals(that.longitude) : that.longitude != null) return false;
        if (latitude != null ? !latitude.equals(that.latitude) : that.latitude != null) return false;
        if (available != null ? !available.equals(that.available) : that.available != null) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;
        if (contactPersonId != null ? !contactPersonId.equals(that.contactPersonId) : that.contactPersonId != null)
            return false;
        if (dividendTypeId != null ? !dividendTypeId.equals(that.dividendTypeId) : that.dividendTypeId != null)
            return false;
        if (cityId != null ? !cityId.equals(that.cityId) : that.cityId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (orgName != null ? orgName.hashCode() : 0);
        result = 31 * result + (joinDate != null ? joinDate.hashCode() : 0);
        result = 31 * result + (address != null ? address.hashCode() : 0);
        result = 31 * result + (longitude != null ? longitude.hashCode() : 0);
        result = 31 * result + (latitude != null ? latitude.hashCode() : 0);
        result = 31 * result + (available != null ? available.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (contactPersonId != null ? contactPersonId.hashCode() : 0);
        result = 31 * result + (dividendTypeId != null ? dividendTypeId.hashCode() : 0);
        result = 31 * result + (cityId != null ? cityId.hashCode() : 0);
        return result;
    }
}
